<%@ page language="java" import="java.util.*"
pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="css/main.css">
	
   <style type="text/css">

	.content1 {
	
		width:99%;
		height:auto;
		margin:0;
		padding:0px 0px 0px 0px;
		border:5px solid #EEEEEE;
		
	}
	td {
	
	text-align : center;
	
	}
	
	
	</style>
  </head>
  
  <body>
  
  <%
     float price = 432.456f;
  	 session.setAttribute("price", price);
  	 
  
  %>

     <div class="main">
    	<jsp:include page="head.jsp"/>
    
    	
    
    	<div class="content">
    	  
    		  <div class="content1">
    		  <h4>&lt;fmt:formatNumber&gt;</h4>
    		 
    		 <fmt:formatNumber value="${sessionScope.price }" 
    		 var="num" maxFractionDigits="2" type="currency" currencyCode="CNY"/>
    		 格式化数字为：${num }<br>
    		
    		  <br><hr>
    		  </div>
    		  
    		  
    		    <div class="content1">
    		  <h4>&lt;fmt:formatDate&gt;</h4>
    		 <%
    		 	pageContext.setAttribute("date", new java.util.Date());
    		 %>
    		 
    		 <fmt:formatDate value="${date }" type="both" dateStyle="default" timeStyle="default" var="dateValue"/>
    		 default 显示的时间： ${dateValue }<br>
    		 
    		 <fmt:formatDate value="${date }" type="both" dateStyle="short" timeStyle="short" var="dateValue"/>
    		 short 显示的时间： ${dateValue }<br>
    		 
    		 <fmt:formatDate value="${date }" type="both" dateStyle="medium" timeStyle="medium" var="dateValue"/>
    		 medium 显示的时间： ${dateValue }<br>
    		 
    		 <fmt:formatDate value="${date }" type="both" dateStyle="long" timeStyle="long" var="dateValue"/>
    		 long 显示的时间： ${dateValue }<br>
    		 
    		 	 <fmt:formatDate value="${date }" type="both" dateStyle="full" timeStyle="full" var="dateValue"/>
    		 full 显示的时间： ${dateValue }<br>
    		 
    		 	 <fmt:formatDate value="${date }" type="both" pattern="yyyy年MM月dd日HH时mm分ss秒SSS毫秒" var="dateValue" timeZone="GMT+08:00"/>
    		 自定义 显示的时间： ${dateValue }<br>
    		 
    		 
    		
    		  
    		
    		  <br><hr>
    		  </div>
    		  
    		  
    		
        </div>
    		 
    		  
    		
    	<jsp:include page="copyright.jsp" />
    
    </div>
  </body>
</html>
